<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./axios.js"></script>

    <script>
        //  目标：调用接口，请求第6个省的第1个市下的地区列表
        axios.defaults.baseURL = 'http://ajax-api.itheima.net'
        axios.get('/api/province').then(res=>{
            const pname = res.data.data[5]
            console.log(pname)
            axios.get('/api/city?pname='+pname).then(res =>{
                const cname = res.data.data[0]
                console.log(cname)
                axios.get(`/api/area?pname=${pname}&cname=${cname}`).then(res => {
                    console.log(res.data.data)
                })
            })
        })

    </script>
</body>
</html>